/* 
 * Selling Partner API for Listings Items
 *
 * The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API.  For more information, see the [Listings Items API Use Case Guide](doc:listings-items-api-v2021-08-01-use-case-guide).
 *
 * OpenAPI spec version: 2021-08-01
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */

using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;

namespace FikaAmazonAPI.AmazonSpApiSDK.Models.ListingsItems
{
    /// <summary>
    /// Vendor procurement information for the listings item.
    /// </summary>
    [DataContract]
    public partial class ItemProcurement :  IEquatable<ItemProcurement>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ItemProcurement" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ItemProcurement() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ItemProcurement" /> class.
        /// </summary>
        /// <param name="costPrice">The price (numeric value) that you want Amazon to pay you for this product. (required).</param>
        public ItemProcurement(Money costPrice = default(Money))
        {
            // to ensure "costPrice" is required (not null)
            if (costPrice == null)
            {
                throw new InvalidDataException("costPrice is a required property for ItemProcurement and cannot be null");
            }
            else
            {
                this.CostPrice = costPrice;
            }
        }
        
        /// <summary>
        /// The price (numeric value) that you want Amazon to pay you for this product.
        /// </summary>
        /// <value>The price (numeric value) that you want Amazon to pay you for this product.</value>
        [DataMember(Name="costPrice", EmitDefaultValue=false)]
        public Money CostPrice { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append("class ItemProcurement {\n");
            sb.Append("  CostPrice: ").Append(CostPrice).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }
  
        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return JsonConvert.SerializeObject(this, Formatting.Indented);
        }

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="input">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object input)
        {
            return this.Equals(input as ItemProcurement);
        }

        /// <summary>
        /// Returns true if ItemProcurement instances are equal
        /// </summary>
        /// <param name="input">Instance of ItemProcurement to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ItemProcurement input)
        {
            if (input == null)
                return false;

            return 
                (
                    this.CostPrice == input.CostPrice ||
                    (this.CostPrice != null &&
                    this.CostPrice.Equals(input.CostPrice))
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.CostPrice != null)
                    hashCode = hashCode * 59 + this.CostPrice.GetHashCode();
                return hashCode;
            }
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
